<template>
	<view class="introDetail">
		<view class="main">
			<image :src="mainObj[0].imageT" mode="widthFix"
				style="width: 100%;box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.25);"></image>
			<image v-for="(item,index) in mainObj[0].image" :key="index" :src="item" mode="widthFix"
				style="width: 100%;margin-top: 20rpx;">
			</image>
		</view>

		<view class="bottom">
			<view class="box1">
				<view>
					<u-icon name="home-fill" color="#fff" size="28" @click="toHome"></u-icon>
				</view>
			</view>
			<view class="box2">
				<u-button color="#1D3AA1" shape="circle" text="立即检测" @click="toTest"></u-button>
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				obj: {},
				mainObj: [],
				list: [{
						name: "送检验货",
						imageT: "http://applet.atptest.com/23041220.jpg",
						image: ["http://applet.atptest.com/23041212.jpg"]
					},
					{
						name: "超声波扫描",
						imageT: "http://applet.atptest.com/23041215.jpg",
						image: ["http://applet.atptest.com/23041211.png"]
					},
					{
						name: "X-Ray检测",
						imageT: "http://applet.atptest.com/23041214.jpg",
						image: ["http://applet.atptest.com/23041210.png"]
					},
					{
						name: "电性能检测",
						imageT: "http://applet.atptest.com/23041216.jpg",
						image: ["http://applet.atptest.com/23041213.jpg"]
					},
					{
						name: "环境温度测试",
						imageT: "http://applet.atptest.com/23041217.jpg",
						image: ["http://applet.atptest.com/23041208.jpg", "http://applet.atptest.com/23041209.jpg"]
					},
					{
						name: "可焊性",
						imageT: "http://applet.atptest.com/23041219.jpg",
						image: ["http://applet.atptest.com/2023051905.jpg"]
					},
					{
						name: "开盖",
						imageT: "http://applet.atptest.com/23041218.jpg",
						image: ["http://applet.atptest.com/2023051903.png", "http://applet.atptest.com/2023051904.png"]
					}
				]
			};
		},
		methods: {
			toHome() {
				uni.switchTab({
					url: '/pages/home/home'
				})
			},
			toTest() {
				uni.switchTab({
					url: '/pages/test/test'
				})
			}
		},
		onLoad(options) {
			this.obj = JSON.parse(decodeURIComponent(options.i))
			uni.setNavigationBarTitle({
				title: this.obj.name,
			})
			this.mainObj = this.list.filter((item) => {
				return item.name === this.obj.name
			})
		}
	}
</script>

<style lang="scss">
	.introDetail {
		padding: 20rpx 32rpx 100rpx;
		.main{
			padding-bottom: 20rpx;
		}
		.bottom {
			position: fixed;
			bottom: 0;
			left: 0;
			display: flex;
			width: 100%;
			padding: 30rpx 32rpx;
			color: #fff;
			background-color: #fff;
			box-sizing: border-box;

			.box1 {
				flex: 1;
				text-align: center;

				view {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 80rpx;
					height: 80rpx;
					border-radius: 50%;
					background-color: #1D3AA1;
				}
			}

			.box2 {
				flex: 5;
				text-align: center;
			}
		}

	}
</style>
